﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Common.Views;
using Common;

namespace ElectroSystem.Controllers
{
    public class ReportController : MenusController
    {
        //
        // GET: /Report/

        public ActionResult Index()
        {
            return View();
        }

        public PartialViewResult HighlyRatedItem()
        {
            List<StatisticalView> highlyrated = new OrdersServ.OrdersServiceClient().HighlyRatedItem();

            return PartialView("_highlyrated", highlyrated);
        }

        public PartialViewResult MostPurchasedItem()
        {
            List<StatisticalView> mostpurchased = new OrdersServ.OrdersServiceClient().MostPurchasedItem();

            return PartialView("_mostpurchased", mostpurchased);
        }

        public PartialViewResult HighestNoFaults()
        {
            List<StatisticalView> highnofaults = new OrdersServ.OrdersServiceClient().HighestNumOfFaults();

            return PartialView("_highnofaults", highnofaults);
        }

        public PartialViewResult LowestNoFaults()
        {
            List<StatisticalView> lownofaults = new OrdersServ.OrdersServiceClient().LeastNumOfFaults();

            return PartialView("_highnofaults", lownofaults);
        }

    }
}
